<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>

	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>订单详情</title>
		<link rel="stylesheet" href="<%=request.getContextPath()%>/resources/css/bootstrap.min.css" type="text/css" />
		<script src="<%=request.getContextPath()%>/resources/js/jquery-1.11.3.min.js" type="text/javascript"></script>
		<script src="<%=request.getContextPath()%>/resources/js/bootstrap.min.js" type="text/javascript"></script>
		<script type="text/javascript" src="<%=request.getContextPath()%>/resources/js/jquery-heima-0.0.1.js" ></script>
		<!-- 引入自定义css文件 style.css -->
	</head>

<body>
			<div class="container-fluid">
				<!--头部-->
				<div id="header" style="min-height: 130px;"><jsp:include page="/header.jsp" /></div>
				<div class="container">
					<div class="row">
						<div style="margin:0 auto;margin-top:10px;width:950px;">
							<strong>订单详情</strong>
							<table  class="table table-bordered">
								<tbody id="order">
									<tr class="warning">
										<th colspan="2">
											订单编号:<span id="oid">${order.oid}</span>
										</th>
										<c:if test="${order.state==0}">
											<th colspan="1">订单状态:<span>未付款</span> </th><th colspan="1">
										</c:if>
										<c:if test="${order.state==1}">
											<th colspan="1">订单状态:<span>已付款</span> </th><th colspan="1">
										</c:if>
										<c:if test="${order.state==2}">
											<th colspan="1">订单状态:<span>已发货</span> </th><th colspan="1">
										</c:if>
										<c:if test="${order.state==3}">
											<th colspan="1">订单状态:<span>已完成</span> </th><th colspan="1">
										</c:if>


										<th colspan="2">下单时间:<span id="ordertime">${order.ordertime}</span> </th>
									</tr>
									<tr class="warning">
										<th>图片</th>
										<th>商品</th>
										<th>价格</th>
										<th>数量</th>
										<th>小计</th>
									</tr>
									<c:forEach items="${order.orderViewList}" var="i">
									<tr class="active">
										<td width="60" width="40%">
											<input type="hidden" name="id" value="22">
											<img src="<%=request.getContextPath()%>/${i.pimage}" width="70" height="60">
										</td>
										<td width="30%">
											<a target="_blank">${i.pname}</a>
										</td>
										<td width="20%">
											￥${i.shop_price}
										</td>
										<td width="10%">
										${i.count}
										</td>
										<td width="15%">
											<span class="subtotal">￥${i.subTotal}</span>
										</td>
									</tr>
									</c:forEach>
								</tbody>
							</table>
						</div>
		
						<div style="text-align:right;margin-right:120px;">
							商品金额: <strong style="color:#ff6600;">￥  <span id="total">${order.total}</span> 元</strong>
						</div>
		
					</div>

					<div class="">
						<hr/>
						<c:if test="${order.state==0}">

						<form id="orderForm" action="<%=request.getContextPath()%>/orderServlet?method=pay" method="post" class="form-horizontal" style="margin-top:5px;margin-left:150px;">
							<input type="hidden" name="oid" value="${order.oid}">
							<div class="form-group">
								<label for="username" class="col-sm-1 control-label">地址</label>
								<div class="col-sm-5">
									<input type="text" name="address" class="form-control" id="username" placeholder="请输入收货地址">
								</div>
							</div>
							<div class="form-group">
								<label for="inputPassword3" class="col-sm-1 control-label">收货人</label>
								<div class="col-sm-5">
									<input type="text" name="name" class="form-control" id="inputPassword3" placeholder="请输收货人">
								</div>
							</div>
							<div class="form-group">
								<label for="confirmpwd" class="col-sm-1 control-label">电话</label>
								<div class="col-sm-5">
									<input type="text" name="telephone"  class="form-control" id="confirmpwd" placeholder="请输入联系方式">
								</div>
							</div>
						
		
						<hr/>
		
						<div style="margin-top:5px;margin-left:150px;">
							<strong>选择银行：</strong>
							<p>
								<br/>
								<input type="radio" name="pd_FrpId" value="ICBC-NET-B2C" checked="checked" />工商银行
								<img src="<%=request.getContextPath()%>/resources/bank_img/icbc.bmp" align="middle" />&nbsp;&nbsp;&nbsp;&nbsp;
								<input type="radio" name="pd_FrpId" value="BOC-NET-B2C" />中国银行
								<img src="<%=request.getContextPath()%>/resources/bank_img/bc.bmp" align="middle" />&nbsp;&nbsp;&nbsp;&nbsp;
								<input type="radio" name="pd_FrpId" value="ABC-NET-B2C" />农业银行
								<img src="<%=request.getContextPath()%>/resources/bank_img/abc.bmp" align="middle" />
								<br/>
								<br/>
								<input type="radio" name="pd_FrpId" value="BOCO-NET-B2C" />交通银行
								<img src="<%=request.getContextPath()%>/resources/bank_img/bcc.bmp" align="middle" />&nbsp;&nbsp;&nbsp;&nbsp;
								<input type="radio" name="pd_FrpId" value="PINGANBANK-NET" />平安银行
								<img src="<%=request.getContextPath()%>/resources/bank_img/pingan.bmp" align="middle" />&nbsp;&nbsp;&nbsp;&nbsp;
								<input type="radio" name="pd_FrpId" value="CCB-NET-B2C" />建设银行
								<img src="<%=request.getContextPath()%>/resources/bank_img/ccb.bmp" align="middle" />
								<br/>
								<br/>
								<input type="radio" name="pd_FrpId" value="CEB-NET-B2C" />光大银行
								<img src="<%=request.getContextPath()%>/resources/bank_img/guangda.bmp" align="middle" />&nbsp;&nbsp;&nbsp;&nbsp;
								<input type="radio" name="pd_FrpId" value="CMBCHINA-NET-B2C" />招商银行
								<img src="<%=request.getContextPath()%>/resources/bank_img/cmb.bmp" align="middle" />
		
							</p>
							<hr/>
							<p style="text-align:right;margin-right:100px;">
								<a href="<%=request.getContextPath()%>/orderServlet?method=delOrder&oid=${order.oid}" style="margin: 0;padding: 0;"><img src="<%=request.getContextPath()%>/resources/img/quxiaobutton.jpg" width="204" height="51" border="0" /></a>&nbsp;&nbsp;&nbsp;<button type="submit" style="border:0;margin: 0;padding: 0;"><img src="<%=request.getContextPath()%>/resources/img/finalbutton.gif" width="204" height="51" border="0" /></button>
							</p>
							<hr/>
						</div>
						</form>
						</c:if>

						<c:if test="${order.state==1}">
						<h1>等待发货</h1>
						</c:if>

						<c:if test="${order.state==2}">
							<form action="<%=request.getContextPath()%>/orderServlet?method=userConfirmOrder" method="post">
								<input type="hidden" name="oid" value="${order.oid}">
								<h1>快递单号： ${order.couriernum}</h1><br>
								<p style="text-align:right;margin-right:100px;">
									<button type="submit" style="margin: 0;padding: 0;"><img src="<%=request.getContextPath()%>/resources/img/querenbutton.jpg" width="204" height="51" border="0" /></button>
								</p>
							</form>
						</c:if>
						<c:if test="${order.state==3}">
							<form action="<%=request.getContextPath()%>/orderServlet?method=userDelOrder" method="post">
								<input type="hidden" name="oid" value="${order.oid}">
								<p style="text-align:right;margin-right:100px;">
									<button type="submit" style="margin: 0;padding: 0;"><img src="<%=request.getContextPath()%>/resources/img/shanchubutton.jpg" width="204" height="51" border="0" /></button>
								</p>
							</form>
						</c:if>
					</div>


				</div>
				<!--尾部-->
				<div id="footer"  style="min-height: 203px;"><jsp:include page="/foot.jsp" /></div>
		</div>
	</body>
</html>